package com.kaifamiao.www.ioDemo.do0923;

import java.lang.reflect.Method;

public class getDeclaredMethodDemo2 {

    public static void main(String[] args) throws NoSuchMethodException {

        Class<Student> cl = Student.class;
        Method dm = cl.getDeclaredMethod("getName");
        System.out.println(dm);
        //所有方法
        Method[] method = cl.getDeclaredMethods();
        for (Method method1 : method){
            System.out.println(method1);
        }
    }
}
